<?php

if (!defined('DIR_SEP'))
    define('DIR_SEP', DIRECTORY_SEPARATOR);

if (!defined('MODULES_DIR'))
    define('MODULES_DIR', dirname(__FILE__).DIR_SEP."..".DIR_SEP);

require_once(MODULES_DIR."IManager.inc");
require_once(MODULES_DIR.'db.inc');
require_once(MODULES_DIR.'util.inc');
require_once(MODULES_DIR.'tag.inc');

class FeedsManager implements IManager
{
	public function getMenu()
	{
		global $G_HOME;
		
		$menu =  "<li class='navCategory'>Recent Feeds</li>
				<li class='navItem'><a href='".Util::combinePath($G_HOME,"index.php?pg=feeds&amp;itemId=0")."'>Latest Feeds</a></li>";
						
		$menu .= "<li class='navCategory'>Categories</li>";

		$array = Tag::getFeedCount();
		foreach($array as $row)
			$menu .= "<li class='navItem'><a href='".Util::combinePath($G_HOME,"index.php?pg=feed_category&amp;catId=".$row['id']."&amp;itemId=0")."'>".$row['tag']."</a></li>";
			
		return $menu;
	}
	
	public function getAdminMenu()
	{
		global $G_HOME;
		
		return "<li class='navCategory'>Feeds management</li>
				<li class='navItem'><a href='".Util::combinePath($G_HOME,"index.php?pg=manage_feeds")."'>Manage feeds</a></li>
				<li class='navItem'><a href='".Util::combinePath($G_HOME,"index.php?pg=add_feed")."'>Add feed</a></li>
				<li class='navItem'><a href='".Util::combinePath($G_HOME,"index.php?pg=manage_tags")."'>Manage tags</a></li>";
	}
}

?>